﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 
error_reporting(0);
	  

class MyPrizeBean
{
	
	public $heading;
	public $name;
	public $images;
	public $title;
	public $addtime;
	public $reply;
	public $content;
	public $like;
	public $cid;
	
	function __construct($heading,$name,$images,$title,$addtime,$reply,$content,$like,$cid)
	{
		$this->heading      = $heading;
		$this->name      = $name;
		$this->images      = $images;
		$this->title      = $title;
		$this->addtime      = $addtime;
		$this->reply      = $reply;
		$this->content      = $content;
		$this->like      = $like;
		$this->cid      = $cid;
	
	}
}

if($_REQUEST['page']!="")
{
$de=$_REQUEST['page']*$_REQUEST['pagesize'];
$size=$_REQUEST['pagesize'];
}

else
{
$de=0;
$size=5;
}


$upfile = 'uploads/';
if (!file_exists($upfile)) { 
        mkdir($upfile, 0777, true);
 }


   $rert31=mysql_query("select *from talks where  userid ='".$_REQUEST['userid']."' order by id desc limit $de,$size ");
  $prize = array();
 while($rowf=mysql_fetch_array($rert31)){
 
   $de=array();//图片
		  if($rowf[images]!="")
		  {
		  $ime=$rowf[images];
		         $de=explode("," ,$ime);
			}
				 //图片end

// $pic_quantity = count($de);
$smallImg=array();
if($rowf[thumbImages]!="")
          {
          $ime=$rowf[thumbImages];
                 $smallImg=explode("," ,$ime);
                 }


  
     $rert32=mysql_query("select *from user where userid='".$rowf[userid]."'");
     $rowf3=mysql_fetch_array($rert32);




   
		$prize[] = new MyPrizeBean($rowf3['images'],$rowf3['niname'],$smallImg,$rowf['title'],$rowf['addtime'],$rowf['replymember'],$rowf['content'],$rowf['xihuan'],$rowf['id']);
		

}
echo json_encode($prize);





?>